#pragma once
#include "TcpServer.h"

#

class TcpConnection;
class ThreadPool;

class EchoServer
{
private:
    TcpServer _server;
    std::shared_ptr<ThreadPool> _pool;

public:
    EchoServer(const std::string& ip,uint16_t port);
    ~EchoServer();
    void start();
    void stop();
private:
    void onNewConnection(const TcpConnectionPtr& conn);
    void onMessage(const TcpConnectionPtr& conn);
    void onClose(const TcpConnectionPtr& conn);
};